package com.hu.chat.controller;

import com.hu.chat.config.WebInterceptor;
import com.hu.chat.model.R;
import com.hu.chat.model.vo.UserListVo;
import com.hu.chat.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 功能描述：
 *
 * @Author huyouzhong
 * @Date 2024/1/2 10:53
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    UserService userService;

    // 用户列表
    @GetMapping("/list")
    public R<List<UserListVo>> list() {
        return R.ok(userService.list(WebInterceptor.getUserId()));
    }

}
